import React, { useState } from 'react'
import { useInterval } from 'usehooks-ts'

export function Interval () {

    const [ datetime, setDatetime ] = useState(new Date())

    useInterval(() => {
        setDatetime(new Date())
    }, 1000)

    return (
        <div className={ 'p-20 bg-black' }>
            <p className={ 'text-white' }>
                { datetime.toString() }
            </p>
        </div>
    )
}
